<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="parent">
        <p id="good">good</p>
        <!-- 改为<h2>标题</h2> -->
    </div>
    <script>
        /* DOM就是增删改元素的标准，可以动态的修改元素的内容，样式，结构 */
        var parent=document.getElementById("parent")
        var p=document.getElementsByTagName("p")[0];
        var h2=document.createElement("h2");
        h2.innerHTML="标题";
        parent.replaceChild(h2,p)
        /* 
        修改--替换DOM节点
        replaceChild(newChild,oldChild) 
        */
    </script>
</body>
</html>